* {
	margin: 0;
	padding: 0;
}

#wrap {
	height: 2000px;
	background: #fcc;
	margin: 50px;
	padding: 20px;
	border: 3px solid #00f;
	position: relative;
}

.box {
	margin: 30px;
	padding: 10px;
	border: 5px dashed #f00;
}

#d1 {
	width: 100%;
	border-color: #0f0;
	background: #333;
	position: fixed;
	margin: 0;
	left: 0px;
	top: 0px; 
}

#d2 {
	background: #999;
	position: relative;
	top: 50px;
	z-index: 2;
}

#d3 {
	background: #cff;
	border-color: #000;
	position: relative;
	z-index: 3;
}

.clear {
	clear: both;
}